<% layout('/layouts/default.html', {title: '商家员工管理', libs: ['validate']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header with-border">
			<div class="box-title">
				<i class="fa fa-list-alt"></i> ${text(wxBusinessUser.isNewRecord ? '新增商家员工' : '编辑商家员工')}
			</div>
			<div class="box-tools pull-right">
				<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
			</div>
		</div>
		<#form:form id="inputForm" model="${wxBusinessUser}" action="${ctx}/wx/wxBusinessUser/saveBusinessUser" method="post" class="form-horizontal">
			<div class="box-body">
				<div class="form-unit">${text('基本信息')}</div>
				<#form:hidden path="id"/>
				<div class="row">
					<div class="col-xs-6" style="display: none;">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> ${text('商家id')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="businessId" maxlength="20" class="form-control required digits"/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								${text('商家名称')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<span class="form-control required digits">${wxBusiness.name}</span>
							</div>
						</div>
					</div>
					<!--<div class="col-xs-6">-->
						<!--<div class="form-group">-->
							<!--<label class="control-label col-sm-4" title="">-->
								<!--<span class="required ">*</span> ${text('关联的user表中的id')}：<i class="fa icon-question hide"></i></label>-->
							<!--<div class="col-sm-8">-->
								<!--<#form:input path="userId" maxlength="20" class="form-control required digits"/>-->
							<!--</div>-->
						<!--</div>-->
					<!--</div>-->
				</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> 用户多选：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:treeselect id="wxUser" title="用户选择"
								path="wxUser.id" labelPath="wxUser.id"
								url="${ctx}/wx/wxBusinessUser/treeData?activityId=${activityId}"
								class="" allowClear="true" checkbox="true"/>
							</div>
						</div>
					</div>
					<!--<div class="col-xs-6">-->
						<!--<div class="form-group">-->
							<!--<label class="control-label col-sm-4" title="">-->
								<!--<span class="required ">*</span> ${text('关联的user表中的openid')}：<i class="fa icon-question hide"></i></label>-->
							<!--<div class="col-sm-8">-->
								<!--<#form:input path="userOpenid" maxlength="200" class="form-control required"/>-->
							<!--</div>-->
						<!--</div>-->
					<!--</div>-->
					<!--<div class="col-xs-6">-->
						<!--<div class="form-group">-->
							<!--<label class="control-label col-sm-4" title="">-->
								<!--<span class="required ">*</span> ${text('员工姓名')}：<i class="fa icon-question hide"></i></label>-->
							<!--<div class="col-sm-8">-->
								<!--<#form:input path="userName" maxlength="255" class="form-control required"/>-->
							<!--</div>-->
						<!--</div>-->
					<!--</div>-->
				</div>
				<!--<div class="row">-->
					<!--<div class="col-xs-6">-->
						<!--<div class="form-group">-->
							<!--<label class="control-label col-sm-4" title="">-->
								<!--<span class="required ">*</span> ${text('员工手机号')}：<i class="fa icon-question hide"></i></label>-->
							<!--<div class="col-sm-8">-->
								<!--<#form:input path="phone" maxlength="200" class="form-control required"/>-->
							<!--</div>-->
						<!--</div>-->
					<!--</div>-->
				<!--</div>-->
				<!--<div class="row">-->
					<!--<div class="col-xs-12">-->
						<!--<div class="form-group">-->
							<!--<label class="control-label col-sm-2" title="">-->
								<!--<span class="required ">*</span> ${text('备注')}：<i class="fa icon-question hide"></i></label>-->
							<!--<div class="col-sm-10">-->
								<!--<#form:textarea path="remarks" rows="4" maxlength="200" class="form-control required"/>-->
							<!--</div>-->
						<!--</div>-->
					<!--</div>-->
				<!--</div>-->
			</div>
			<div class="box-footer">
				<div class="row">
					<div class="col-sm-offset-2 col-sm-10">
						<% if (hasPermi('wx:wxBusinessUser:edit')){ %>
							<button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i> ${text('保 存')}</button>&nbsp;
						<% } %>
						<button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="js.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> ${text('关 闭')}</button>
					</div>
				</div>
			</div>
		</#form:form>
	</div>
</div>
<% } %>
<script>
$("#inputForm").validate({
	submitHandler: function(form){
		js.ajaxSubmitForm($(form), function(data){
			js.showMessage(data.message);
			if(data.result == Global.TRUE){
				js.closeCurrentTabPage(function(contentWindow){
					contentWindow.page();
				});
			}
		}, "json");
    }
});


</script>
<script id="treeselectTpl" type="text/template"></script>